package com.lightjet.macross.base.awf.repository;

import com.lightjet.macross.base.awf.domain.BizFormLog;
import com.lightjet.macross.common.core.BaseRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @author : lijia
 * @version : 1.0 2019-03-19 09:17
 * description : 流程表单日志表数据层接口
 */

@Repository("bizFormLogRepository")
public interface BizFormLogRepository extends BaseRepository<BizFormLog,Integer> {

    @Query("select t.mfId from BizFormLog t where t.taskId = :taskid")
    String findMonggoFormId(@Param("taskid") String taskid);

    @Query("select max(cast(t.taskId as int)) from BizFormLog t where t.procinstId = :piid")
    Integer findLatestTaskIdByPiid(@Param("piid") String piid);

}